package net.yondervision.hrfsp.sdk.esign.domain.request;

import cn.hutool.http.Method;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.yondervision.hrfsp.sdk.esign.domain.AbstractESignRequest;
import net.yondervision.hrfsp.sdk.esign.domain.ESignRequest;
import net.yondervision.hrfsp.sdk.esign.domain.request.body.SignflowsDocumentsSaveParamBody;
import net.yondervision.hrfsp.sdk.esign.domain.request.path.SignflowsDocumentsSaveParamPath;
import net.yondervision.hrfsp.sdk.esign.domain.response.SignflowsDocumentsSaveResponse;

/**
 * @author Cash Zhang
 * @version v1.0
 * @since 2019/09/29 17:11
 */
@Data
@Builder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class ESsignflowsDocumentsSaveRequest extends AbstractESignRequest implements
    ESignRequest<SignflowsDocumentsSaveResponse> {

  private SignflowsDocumentsSaveParamPath signflowsDocumentsSaveParamPath;
  private SignflowsDocumentsSaveParamBody signflowsDocumentsSaveParamBody;

  public ESsignflowsDocumentsSaveRequest(
      SignflowsDocumentsSaveParamPath signflowsDocumentsSaveParamPath,
      SignflowsDocumentsSaveParamBody signflowsDocumentsSaveParamBody) {
    this.signflowsDocumentsSaveParamPath = signflowsDocumentsSaveParamPath;
    this.signflowsDocumentsSaveParamBody = signflowsDocumentsSaveParamBody;
    this.setParamPath(signflowsDocumentsSaveParamPath);
    this.setParamBody(signflowsDocumentsSaveParamBody);
  }

  @Override
  public String getUrl() {
    return "/signflows/{flowId}/documents";
  }

  @Override
  public Method getMethodType() {
    return Method.POST;
  }


  @Override
  public Class<SignflowsDocumentsSaveResponse> getResponseClass() {
    return SignflowsDocumentsSaveResponse.class;
  }

}
